Skip to content

[5.x] Checks for Closure instances instead of is_callable inside Route::statamic(...) #11809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

JohnathonKoster
Copy link
Contributor

This PR fixes #11808 by checking if passed views to Route::statamic('/the-url', 'the_view') are Closure instances instead of calling is_callable.

Globally available functions, such as auth, will return true when using is_callable, making those names unusable as view names.

Global functions will return true when using `is_callable`
@duncanmcclean duncanmcclean merged commit 7be0481 into statamic:5.x May 22, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Route returns a 500 error
2 participants